/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package session;

import entity.Serie;
import entity.SerieHasGenre;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author Lisha
 */
@Stateless
public class SerieHasGenreFacade extends AbstractFacade<SerieHasGenre> {
    @PersistenceContext(unitName = "emangaPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public SerieHasGenreFacade() {
        super(SerieHasGenre.class);
    }
    
    public List<SerieHasGenre> findBySerieId(int s) {
        Query q = em.createNamedQuery("SerieHasGenre.findBySerieId");
        q.setParameter("serieId", s);
        return q.getResultList();
    }
    
}
